$(function() {







    // $(document).on("mousewheel DOMMouseScroll", function(e) {
    $(".block_scroll").on("mousewheel DOMMouseScroll", function(e) {
        // console.log("block scroll")
    })

    $(".scroll").on("mousewheel DOMMouseScroll", function(e) {
        var delta = (e.originalEvent.wheelDelta && (e.originalEvent.wheelDelta > 0 ? 1 : -1)) || // chrome & ie
            (e.originalEvent.detail && (e.originalEvent.detail > 0 ? -1 : 1)); // firefox

        console.log($(document).scrollTop())
        if (delta < 0 && $(document).scrollTop() >= 2000) {
            // 一个弹的动画
            $('body,html').animate({
                scrollTop: 2800
            }, 500, function() {
                $('body,html').animate({
                    scrollTop: 2038
                }, 500)
            })
            console.log('bounce')
            return

        }


        if (delta > 0) {
            // 向上滚
            console.log("wheelup");
            $('body,html').animate({
                scrollTop: $(window).scrollTop() - 680
            }, 1000)

        } else if (delta < 0) {
            // 向下滚
            console.log("wheeldown");
            $('body,html').animate({
                scrollTop: $(window).scrollTop() + 680
            }, 1000)
        }
    });
})